#include "Date.h"

void test1()
{
	Date d1(2000, 2, 2);
	Date d2(3000, 2, 2);
	cout << (d1 > d2) << endl;
}

void test2()
{
	Date d1(2100, 2, 2);
	Date d2(2000, 2, 2);
	cout << (d1 == d2) << endl;
}


int main()
{
    int date1 = 0, date2 = 0;
    cin >> date1 >> date2;
    int year1 = date1 / 1000;
    int remain1 = date1 % 1000;
    int year2 = date2 / 1000;
    int remain2 = date2 % 1000;
    int month1 = remain1 / 100;
    int day1 = remain1 % 100;
    int month2 = remain2 / 100;
    int day2 = remain2 % 100;

    Date d1(year1, month1, day1);
    Date d2(year2, month2, day2);
    cout << d1 << endl << d2 << endl;
	return 0;
}